package com.jxcq.tensquare.user.dao;

import com.jxcq.tensquare.user.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * 数据访问接口
 *
 * @author CalvinXCui
 */
public interface UserDao extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {

    User findByMobile(String mobile);

    @Query(value = "update tb_user set fanscount = fanscount+? where id=?",nativeQuery =true)
    void updatefasnscount(int x, String friendid);

    @Query(value = "update tb_user set followcount = followcount+? where id=?",nativeQuery =true)
    void updatefollowcount(int x, String userid);
}
